<template>
  <div class="oderInfo">
    <header>订单详情</header>
    <div class="content">
      <table >
        <tr>
          <td>订单号：</td>
          <td class="info">{{$route.params.data.orderNo}}</td>
        </tr>
        <tr>
          <td>创建时间：</td>
          <td class="info">{{$route.params.data.createTime}}</td>
        </tr>
        <tr>
          <td>收件人：</td>
          <td class="info">{{$route.params.data.receiverName}}</td>
        </tr>
        <tr>
          <td>订单状态：</td>
          <td class="info">{{$route.params.data.statusDesc}}</td>
        </tr>
        <tr>
          <td>支付方式：</td>
          <td class="info">{{$route.params.data.paymentTypeDesc}}</td>
        </tr>
        <tr>
          <td>订单金额：</td>
          <td class="info">￥{{$route.params.data.payment}}</td>
        </tr>
      </table>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column label="图片" width="200" align="center" prop="productImage">
          <!--插入图片链接的代码-->
          <template slot-scope="scope">
            <img :src="'http://img.happymmall.com/'+scope.row.productImage" alt="" style="width: 100px;height:100px" />
          </template>
        </el-table-column>

        <el-table-column prop="productName" label="商品信息" width="180"></el-table-column>
        <el-table-column prop="currentUnitPrice" label="单价">
            <template slot-scope="scope">
                ￥{{scope.row.currentUnitPrice}}
          </template>
        </el-table-column>
        <el-table-column prop="quantity" label="数量"></el-table-column>
        <el-table-column prop="totalPrice" label="合计">
            <template slot-scope="scope">
                ￥{{scope.row.totalPrice}}
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  mounted() {
    console.log(this.$route.params.data),
      (this.tableData = this.$route.params.data.orderItemVoList);
  },
  data() {
    return {
      tableData: []
    };
  }
};
</script>

<style lang="scss" scoped>
@import "@/assets/mixinScss.scss";
header {
  @include FontSize(30px);
  @include Size(100%, 100px);
  line-height: 100px;
  box-sizing: border-box;
  padding-left: 20px;
}
.content{
    width: 100%;
    table{
        @include Size(400px,300px);
        .info{
            background: white;
        }
    }
}
</style>